#pragma once
#ifndef QBE_CANVAS_RULERWIDGET_HPP
#define QBE_CANVAS_RULERWIDGET_HPP

#include <QDebug>
#include <QList>
#include <QPainter>
#include <QRect>
#include <QString>
#include <QTimer>
#include <QVector2D>
#include <QVector>
#include <QWidget>

// #include "../common/ServiceEvent.h"
namespace qbe::canvas {

class RulerWidget : public QWidget {
  Q_OBJECT

 public:
  RulerWidget(QWidget* parent = nullptr);
  RulerWidget(QString name, int width, int height, QWidget* parent = nullptr);
  ~RulerWidget() override;

  void onDraw(const QList<QVector<double>>& lines_x, const QList<QVector<double>>& lines_y, const QVector2D& pos);

 protected:
  void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE;

  //  public slots:

 private:
  QString name;
  int width;
  int height;

  QTimer* timer;

  QList<QVector<double>> m_lines_x;
  QList<QVector<double>> m_lines_y;
  QVector2D m_pos;
};

}  // namespace qbe::canvas

#endif